/*
 Navicat Premium Data Transfer

 Source Server         : 本地
 Source Server Type    : MySQL
 Source Server Version : 50732
 Source Host           : dev:3306
 Source Schema         : exam

 Target Server Type    : MySQL
 Target Server Version : 50732
 File Encoding         : 65001

 Date: 15/05/2022 15:31:53
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for answer
-- ----------------------------
DROP TABLE IF EXISTS `answer`;
CREATE TABLE `answer` (
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `student_id` bigint(20) DEFAULT NULL COMMENT '学生id',
  `exam_id` bigint(20) DEFAULT NULL COMMENT '试卷生成及阅卷系统id',
  `topic_id` bigint(20) DEFAULT NULL COMMENT '题目id',
  `answer` text COLLATE utf8mb4_bin COMMENT '答案',
  `fraction` int(11) DEFAULT NULL COMMENT '分数',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of answer
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for answer_results
-- ----------------------------
DROP TABLE IF EXISTS `answer_results`;
CREATE TABLE `answer_results` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `topic_id` bigint(20) DEFAULT NULL COMMENT '题目id',
  `exam_id` bigint(20) DEFAULT NULL COMMENT '考试id',
  `option` text COMMENT '答案',
  `status` tinyint(1) DEFAULT NULL COMMENT '是否阅卷',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=188 DEFAULT CHARSET=utf8 COMMENT='答题结果';

-- ----------------------------
-- Records of answer_results
-- ----------------------------
BEGIN;
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (133, 1, 7, 'qwewq', 1);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (134, 2, 7, 'wqe', 1);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (135, 3, 7, 'A', 1);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (136, 4, 7, '', 1);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (137, 0, 7, 'qwwwe', NULL);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (138, 1, 7, 'qwewq', 1);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (139, 2, 7, 'wqe', NULL);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (140, 3, 7, 'A', NULL);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (141, 4, 7, '', NULL);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (142, 0, 7, 'qwwwe', NULL);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (143, 1, 7, 'qwewq', NULL);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (144, 2, 7, 'wqe', NULL);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (145, 3, 7, NULL, NULL);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (146, 4, 7, NULL, NULL);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (147, 0, 7, 'qwwwe', NULL);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (148, 1, 7, 'qwewq', NULL);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (149, 2, 7, 'wqe', NULL);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (150, 3, 7, NULL, NULL);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (151, 4, 7, 'A', NULL);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (152, 0, 7, 'qwwwe', NULL);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (153, 1, 7, 'qwewq', NULL);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (154, 2, 7, 'wqe', NULL);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (155, 3, 7, NULL, NULL);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (156, 4, 7, NULL, NULL);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (157, 0, 7, 'qwwwe', NULL);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (158, 1, 7, 'qwewq', NULL);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (159, 2, 7, 'wqe', NULL);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (160, 3, 7, NULL, NULL);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (161, 4, 7, NULL, NULL);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (162, 0, 7, 'qwwwe', NULL);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (163, 1, 7, 'qwewq', NULL);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (164, 2, 7, 'wqe', NULL);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (165, 3, 7, NULL, NULL);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (166, 4, 7, NULL, NULL);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (167, 0, 7, 'qwwwe', NULL);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (168, 1, 7, 'qwewq', NULL);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (169, 2, 7, 'wqe', NULL);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (170, 3, 7, NULL, NULL);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (171, 4, 7, NULL, NULL);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (172, 0, 7, 'qwwwe', NULL);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (173, 1, 7, 'qwewq', NULL);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (174, 2, 7, 'wqe', NULL);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (175, 3, 7, NULL, NULL);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (176, 4, 7, NULL, NULL);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (177, 0, 7, 'qwwwe', NULL);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (178, 1, 7, 'qwewq', NULL);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (179, 2, 7, 'wqe', NULL);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (180, 3, 7, NULL, NULL);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (181, 4, 7, NULL, NULL);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (182, 0, 7, 'qwwwe', NULL);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (183, 1, 7, '请问', NULL);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (184, 2, 7, '请问请问', NULL);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (185, 3, 7, 'A', 1);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (186, 4, 7, '', NULL);
INSERT INTO `answer_results` (`id`, `topic_id`, `exam_id`, `option`, `status`) VALUES (187, 0, 7, '闻气味', 1);
COMMIT;

-- ----------------------------
-- Table structure for class
-- ----------------------------
DROP TABLE IF EXISTS `class`;
CREATE TABLE `class` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `name` varchar(40) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '班级名称',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC COMMENT='班级信息表';

-- ----------------------------
-- Records of class
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for course
-- ----------------------------
DROP TABLE IF EXISTS `course`;
CREATE TABLE `course` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `name` varchar(50) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '课程名',
  `teacher_id` bigint(20) DEFAULT NULL COMMENT '课程老师id',
  `introduce` text COLLATE utf8mb4_bin COMMENT '课程介绍',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of course
-- ----------------------------
BEGIN;
INSERT INTO `course` (`id`, `name`, `teacher_id`, `introduce`, `create_time`, `update_time`) VALUES (2, 'liupeng', 30, '', '2022-03-27 00:37:56', '2022-03-27 00:37:56');
INSERT INTO `course` (`id`, `name`, `teacher_id`, `introduce`, `create_time`, `update_time`) VALUES (3, 'liupeng', 30, '22', '2022-05-15 13:41:39', '2022-05-15 13:41:39');
COMMIT;

-- ----------------------------
-- Table structure for course_order
-- ----------------------------
DROP TABLE IF EXISTS `course_order`;
CREATE TABLE `course_order` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `student_id` bigint(20) DEFAULT NULL COMMENT '学生id',
  `course_id` bigint(20) NOT NULL COMMENT '课程id',
  `update_time` datetime DEFAULT NULL COMMENT '最近更新时间',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of course_order
-- ----------------------------
BEGIN;
INSERT INTO `course_order` (`id`, `student_id`, `course_id`, `update_time`, `create_time`) VALUES (3, 30, 2, '2022-05-15 15:22:29', '2022-05-15 15:22:29');
INSERT INTO `course_order` (`id`, `student_id`, `course_id`, `update_time`, `create_time`) VALUES (4, 30, 3, '2022-05-15 15:22:30', '2022-05-15 15:22:30');
COMMIT;

-- ----------------------------
-- Table structure for exam
-- ----------------------------
DROP TABLE IF EXISTS `exam`;
CREATE TABLE `exam` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT ' 主键',
  `name` varchar(30) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '试卷生成及阅卷系统名',
  `start_date` datetime DEFAULT NULL COMMENT '开始时间',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  `course_id` bigint(20) DEFAULT NULL COMMENT '课程id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of exam
-- ----------------------------
BEGIN;
INSERT INTO `exam` (`id`, `name`, `start_date`, `create_time`, `update_time`, `course_id`) VALUES (1, '12334', NULL, '2022-04-13 19:41:43', '2022-04-13 19:41:43', 2);
INSERT INTO `exam` (`id`, `name`, `start_date`, `create_time`, `update_time`, `course_id`) VALUES (6, '2131243', NULL, '2022-04-14 08:25:09', '2022-04-14 08:25:09', 2);
INSERT INTO `exam` (`id`, `name`, `start_date`, `create_time`, `update_time`, `course_id`) VALUES (7, '234234', NULL, '2022-04-14 08:26:32', '2022-04-14 14:15:55', 2);
INSERT INTO `exam` (`id`, `name`, `start_date`, `create_time`, `update_time`, `course_id`) VALUES (8, 'liupeng', NULL, '2022-05-15 13:43:46', '2022-05-15 13:43:46', 2);
INSERT INTO `exam` (`id`, `name`, `start_date`, `create_time`, `update_time`, `course_id`) VALUES (9, 'liupeng', NULL, '2022-05-15 13:44:41', '2022-05-15 13:44:41', 3);
COMMIT;

-- ----------------------------
-- Table structure for exam_topic
-- ----------------------------
DROP TABLE IF EXISTS `exam_topic`;
CREATE TABLE `exam_topic` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `topic_id` bigint(20) DEFAULT NULL COMMENT '题目id',
  `exam_id` bigint(20) DEFAULT NULL COMMENT '考试主键',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC COMMENT='考试题目关系表';

-- ----------------------------
-- Records of exam_topic
-- ----------------------------
BEGIN;
INSERT INTO `exam_topic` (`id`, `topic_id`, `exam_id`) VALUES (4, 1, 2);
INSERT INTO `exam_topic` (`id`, `topic_id`, `exam_id`) VALUES (5, 2, 2);
INSERT INTO `exam_topic` (`id`, `topic_id`, `exam_id`) VALUES (6, 3, 2);
INSERT INTO `exam_topic` (`id`, `topic_id`, `exam_id`) VALUES (7, 1, 3);
INSERT INTO `exam_topic` (`id`, `topic_id`, `exam_id`) VALUES (8, 2, 3);
INSERT INTO `exam_topic` (`id`, `topic_id`, `exam_id`) VALUES (9, 3, 3);
INSERT INTO `exam_topic` (`id`, `topic_id`, `exam_id`) VALUES (10, 1, 4);
INSERT INTO `exam_topic` (`id`, `topic_id`, `exam_id`) VALUES (11, 2, 4);
INSERT INTO `exam_topic` (`id`, `topic_id`, `exam_id`) VALUES (12, 3, 4);
INSERT INTO `exam_topic` (`id`, `topic_id`, `exam_id`) VALUES (13, 4, 4);
INSERT INTO `exam_topic` (`id`, `topic_id`, `exam_id`) VALUES (14, 4, 8);
INSERT INTO `exam_topic` (`id`, `topic_id`, `exam_id`) VALUES (15, 1, 7);
INSERT INTO `exam_topic` (`id`, `topic_id`, `exam_id`) VALUES (16, 2, 7);
INSERT INTO `exam_topic` (`id`, `topic_id`, `exam_id`) VALUES (17, 3, 7);
INSERT INTO `exam_topic` (`id`, `topic_id`, `exam_id`) VALUES (18, 4, 7);
INSERT INTO `exam_topic` (`id`, `topic_id`, `exam_id`) VALUES (19, 4, 8);
COMMIT;

-- ----------------------------
-- Table structure for examinatio_status
-- ----------------------------
DROP TABLE IF EXISTS `examinatio_status`;
CREATE TABLE `examinatio_status` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `exam_id` bigint(20) DEFAULT NULL COMMENT '考试id',
  `student_id` bigint(20) DEFAULT NULL COMMENT '学生id',
  `status` tinyint(1) DEFAULT NULL COMMENT '状态',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8 COMMENT='考试状态';

-- ----------------------------
-- Records of examinatio_status
-- ----------------------------
BEGIN;
INSERT INTO `examinatio_status` (`id`, `exam_id`, `student_id`, `status`) VALUES (39, 7, 30, 1);
COMMIT;

-- ----------------------------
-- Table structure for menu
-- ----------------------------
DROP TABLE IF EXISTS `menu`;
CREATE TABLE `menu` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `name` varchar(20) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '菜单名',
  `parent_id` bigint(20) DEFAULT NULL COMMENT '父菜单id',
  `url` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '菜单url',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of menu
-- ----------------------------
BEGIN;
INSERT INTO `menu` (`id`, `name`, `parent_id`, `url`, `create_time`, `update_time`) VALUES (1, '数据管理', -1, '', '2022-03-01 22:18:43', '2022-03-01 22:18:45');
INSERT INTO `menu` (`id`, `name`, `parent_id`, `url`, `create_time`, `update_time`) VALUES (2, '用户管理', 1, '/index/user', NULL, NULL);
INSERT INTO `menu` (`id`, `name`, `parent_id`, `url`, `create_time`, `update_time`) VALUES (3, '菜单管理', 1, '/index/menu', NULL, NULL);
INSERT INTO `menu` (`id`, `name`, `parent_id`, `url`, `create_time`, `update_time`) VALUES (6, '教学平台', -1, NULL, NULL, NULL);
INSERT INTO `menu` (`id`, `name`, `parent_id`, `url`, `create_time`, `update_time`) VALUES (7, '题目管理', 6, '/index/topic', NULL, '2022-03-15 03:06:39');
INSERT INTO `menu` (`id`, `name`, `parent_id`, `url`, `create_time`, `update_time`) VALUES (8, '课程管理', 6, '/index/course', NULL, '2022-03-15 03:07:01');
INSERT INTO `menu` (`id`, `name`, `parent_id`, `url`, `create_time`, `update_time`) VALUES (17, '角色管理', 1, '/index/role', '2022-03-12 16:36:12', '2022-03-12 16:46:05');
INSERT INTO `menu` (`id`, `name`, `parent_id`, `url`, `create_time`, `update_time`) VALUES (18, '学习天地', -1, '', '2022-03-15 03:02:00', '2022-03-15 03:02:00');
INSERT INTO `menu` (`id`, `name`, `parent_id`, `url`, `create_time`, `update_time`) VALUES (19, '课程订阅', 18, '/index/course/subscribe', '2022-03-15 03:03:54', '2022-03-15 03:03:54');
INSERT INTO `menu` (`id`, `name`, `parent_id`, `url`, `create_time`, `update_time`) VALUES (22, '课程管理', 1, '/index/course', '2022-03-26 07:45:08', '2022-03-26 07:46:06');
INSERT INTO `menu` (`id`, `name`, `parent_id`, `url`, `create_time`, `update_time`) VALUES (24, '考试管理', 1, '/index/exam', '2022-03-26 15:11:57', '2022-04-13 19:58:09');
INSERT INTO `menu` (`id`, `name`, `parent_id`, `url`, `create_time`, `update_time`) VALUES (25, '我的考试', 18, '/index/exam/list2', '2022-03-27 00:43:59', '2022-05-15 15:22:15');
INSERT INTO `menu` (`id`, `name`, `parent_id`, `url`, `create_time`, `update_time`) VALUES (26, '我的成绩', 18, '/index/grade', '2022-03-27 00:48:06', '2022-03-27 00:48:06');
INSERT INTO `menu` (`id`, `name`, `parent_id`, `url`, `create_time`, `update_time`) VALUES (27, '阅卷管理', 6, '/index/exam/list', '2022-03-27 00:50:04', '2022-03-27 00:50:04');
COMMIT;

-- ----------------------------
-- Table structure for menu_role
-- ----------------------------
DROP TABLE IF EXISTS `menu_role`;
CREATE TABLE `menu_role` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `menu_id` bigint(20) DEFAULT NULL COMMENT '菜单id',
  `role_id` bigint(20) DEFAULT NULL COMMENT '角色id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=123 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of menu_role
-- ----------------------------
BEGIN;
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (46, 2, 1);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (47, 2, 2);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (52, 6, 1);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (53, 6, 2);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (54, 7, 1);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (55, 7, 2);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (58, 4, 1);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (59, 4, 2);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (60, 17, 1);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (61, 17, 2);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (62, 10, 1);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (63, 10, 2);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (64, 9, 1);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (65, 9, 2);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (67, 2, 1);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (69, 4, 1);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (70, 6, 1);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (71, 7, 1);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (73, 9, 1);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (74, 10, 1);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (75, 17, 1);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (77, 2, 1);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (79, 4, 1);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (80, 6, 1);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (81, 7, 1);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (83, 9, 1);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (84, 10, 1);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (85, 17, 1);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (87, 2, 3);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (88, 3, 3);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (89, 4, 3);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (90, 6, 3);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (91, 7, 3);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (93, 9, 3);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (94, 10, 3);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (95, 17, 3);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (96, 1, 1);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (97, 2, 1);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (98, 3, 1);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (99, 4, 1);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (100, 6, 1);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (101, 7, 1);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (103, 9, 1);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (104, 10, 1);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (105, 17, 1);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (106, 18, 1);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (107, 19, 1);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (108, 20, 1);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (109, 21, 1);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (110, 22, 1);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (111, 22, 2);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (112, 22, 3);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (113, 24, 1);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (114, 24, 2);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (115, 24, 3);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (116, 25, 1);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (117, 25, 2);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (118, 25, 3);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (119, 26, 1);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (120, 26, 2);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (121, 26, 3);
INSERT INTO `menu_role` (`id`, `menu_id`, `role_id`) VALUES (122, 27, 2);
COMMIT;

-- ----------------------------
-- Table structure for role
-- ----------------------------
DROP TABLE IF EXISTS `role`;
CREATE TABLE `role` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `name` varchar(20) COLLATE utf8mb4_bin NOT NULL COMMENT '名字',
  `role_key` varchar(10) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '角色key',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `teacher_id` bigint(20) DEFAULT NULL COMMENT '老师id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC COMMENT='角色';

-- ----------------------------
-- Records of role
-- ----------------------------
BEGIN;
INSERT INTO `role` (`id`, `name`, `role_key`, `update_time`, `create_time`, `teacher_id`) VALUES (1, '学生', 'student', '2022-02-26 14:22:40', '2022-02-26 14:22:42', NULL);
INSERT INTO `role` (`id`, `name`, `role_key`, `update_time`, `create_time`, `teacher_id`) VALUES (2, '老师', 'teacher', '2022-02-26 14:23:22', '2022-02-26 14:23:24', NULL);
INSERT INTO `role` (`id`, `name`, `role_key`, `update_time`, `create_time`, `teacher_id`) VALUES (3, '管理员', NULL, '2022-03-12 16:57:51', '2022-03-12 16:57:51', NULL);
COMMIT;

-- ----------------------------
-- Table structure for single_choice
-- ----------------------------
DROP TABLE IF EXISTS `single_choice`;
CREATE TABLE `single_choice` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `topic_id` bigint(20) DEFAULT NULL COMMENT '题目id',
  `option_a` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '选项A',
  `option_b` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '选项B',
  `option_c` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '选项C',
  `option_d` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '选项D',
  `right_answer` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '正确选项',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of single_choice
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for student_grade
-- ----------------------------
DROP TABLE IF EXISTS `student_grade`;
CREATE TABLE `student_grade` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT ' 主键',
  `grade` int(11) DEFAULT NULL COMMENT '分数',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  `student_id` bigint(20) DEFAULT NULL COMMENT '学生id',
  `exam` bigint(20) DEFAULT NULL COMMENT '试卷生成及阅卷系统id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of student_grade
-- ----------------------------
BEGIN;
INSERT INTO `student_grade` (`id`, `grade`, `create_time`, `update_time`, `student_id`, `exam`) VALUES (39, 246, NULL, NULL, 30, 7);
COMMIT;

-- ----------------------------
-- Table structure for topic
-- ----------------------------
DROP TABLE IF EXISTS `topic`;
CREATE TABLE `topic` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `title` varchar(50) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '题目',
  `content` text COLLATE utf8mb4_bin COMMENT '题目内容',
  `type` int(11) DEFAULT NULL COMMENT '题目类型,1选择题，2问答题',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `fraction` int(11) DEFAULT NULL COMMENT '分数',
  `option_a` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '选项A',
  `option_b` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '选项B',
  `option_c` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '选项C',
  `option_d` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '选项D',
  `right_answer` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '正确选项',
  `course_id` bigint(20) DEFAULT NULL COMMENT '课程id',
  `difficulty` int(11) DEFAULT NULL COMMENT '题目难度',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of topic
-- ----------------------------
BEGIN;
INSERT INTO `topic` (`id`, `title`, `content`, `type`, `update_time`, `create_time`, `fraction`, `option_a`, `option_b`, `option_c`, `option_d`, `right_answer`, `course_id`, `difficulty`) VALUES (1, '231', '123', 1, '2022-04-14 08:29:53', NULL, NULL, '', '', '', '', NULL, NULL, 1);
INSERT INTO `topic` (`id`, `title`, `content`, `type`, `update_time`, `create_time`, `fraction`, `option_a`, `option_b`, `option_c`, `option_d`, `right_answer`, `course_id`, `difficulty`) VALUES (2, '123', '', 1, '2022-04-14 08:29:57', NULL, NULL, '', '', '', '', NULL, NULL, 1);
INSERT INTO `topic` (`id`, `title`, `content`, `type`, `update_time`, `create_time`, `fraction`, `option_a`, `option_b`, `option_c`, `option_d`, `right_answer`, `course_id`, `difficulty`) VALUES (3, '为2', '123', 1, '2022-04-14 08:30:02', NULL, NULL, '', '', '', '', NULL, NULL, 1);
INSERT INTO `topic` (`id`, `title`, `content`, `type`, `update_time`, `create_time`, `fraction`, `option_a`, `option_b`, `option_c`, `option_d`, `right_answer`, `course_id`, `difficulty`) VALUES (4, '123', '123123123', 2, '2022-05-15 11:08:46', '2022-04-13 23:36:17', 12, 'A', 'B', 'C', 'D', 'A', 2, 0);
COMMIT;

-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `username` varchar(40) COLLATE utf8mb4_bin NOT NULL COMMENT '用户名',
  `password` varchar(255) COLLATE utf8mb4_bin NOT NULL COMMENT '密码',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  `nickname` varchar(40) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '昵称',
  `phone_number` varchar(19) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '手机号',
  `mail` varchar(20) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '邮箱',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `user_username_uindex` (`username`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of user
-- ----------------------------
BEGIN;
INSERT INTO `user` (`id`, `username`, `password`, `create_time`, `update_time`, `nickname`, `phone_number`, `mail`) VALUES (30, '2', '$2a$10$k2IfqTIz1CEnSX2J0OKHWOgllw/K3wpAOeLUBPBgWg4ap8EKGMpZS', '2022-03-06 01:42:46', '2022-03-06 01:42:49', 'test', NULL, NULL);
COMMIT;

-- ----------------------------
-- Table structure for user_role
-- ----------------------------
DROP TABLE IF EXISTS `user_role`;
CREATE TABLE `user_role` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `user_id` bigint(20) DEFAULT NULL COMMENT '学生id',
  `role_id` bigint(20) DEFAULT NULL COMMENT '角色id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=39 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of user_role
-- ----------------------------
BEGIN;
INSERT INTO `user_role` (`id`, `user_id`, `role_id`) VALUES (37, 30, 1);
INSERT INTO `user_role` (`id`, `user_id`, `role_id`) VALUES (38, 30, 2);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
